﻿@model TCC.CMFlow.Models.GrupoAprovacao

@{
    ViewBag.Title = "Adicionar Usuário ao Grupo";
    //Layout = "~/Views/Shared/_Layout.cshtml";
    
    @Styles.Render("~/Content/duallistbox/bootstrap-duallistbox.css")
}

<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h4 class="modal-title" id="myModalLabel">@ViewBag.Title</h4>
</div>

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()

    <div class="modal-body">
        <div class="form-horizontal">
            @Html.ValidationSummary(null, new { @class = "alert alert-danger" })

            <div class="form-group">
                @Html.LabelFor(model => model.Usuarios, "Usuários", new { @class = "control-label col-md-3" })
                <div class="col-md-10">
                    @Html.ListBox("GrupoUsuariosList", ViewBag.GrupoUsuarios as MultiSelectList)
                    @Html.ValidationMessageFor(model => model.Usuarios)
                </div>
            </div>
        </div>
    </div>

    <div class="modal-footer">
        <button class="btn" data-dismiss="modal">Cancelar</button>
        <input type="submit" value="Cadastrar" class="btn btn-primary" />
    </div>
}

<script src="~/Scripts/jquery.bootstrap-duallistbox.js" type="text/javascript"></script>
<script>
    $('select[name="GrupoUsuariosList"]').bootstrapDualListbox({ filterPlaceHolder: 'Pesquisar', infoText: '', infoTextFiltered: '', infoTextEmpty: '' });
</script>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}